package example.data;

import java.util.Collections;
import java.util.Vector;

/**
 * Created by lenovo on 2016/11/7 0007.
 * swap() 函数来旋转向量
 */
public class Swap {
    public static void main(String[] args) {
        Vector<String> v = new Vector<String>();
        v.add("1");
        v.add("2");
        v.add("3");
        v.add("4");
        v.add("5");
        System.out.println(v);
        Collections.swap(v, 1, 3);
        System.out.println("旋转1号位到3号位之间的元素：");
        System.out.println(v);
    }
}
